import buildingApi from '@/config/server/api/building.js'
import dt from '@dt/dt'

function protectList(info) {
  return buildingApi.proRobOption.protectList.fetch(info)
}

function haveOrg(info) {
  return buildingApi.proRobOption.isOrgHad.fetch(info)
}

function addOrgProtect(info) {
  return buildingApi.proRobOption.addOrgProtect.fetch(info)
}

function editOrgProtect(info) {
  return buildingApi.proRobOption.editOrgProtect.fetch(info)
}

function delOrgProtect(info) {
  return buildingApi.proRobOption.delOrgProtect.fetch(info)
}

function getProtectRecord(info) {
  return buildingApi.proRobOption.protectRecord.fetch(info)
}

function getRobList(info) {
  return buildingApi.proRobOption.robList.fetch(info)
}

function editRobItem(info) {
  return buildingApi.proRobOption.editRob.fetch(info)
}

function getRobSopRecord(info) {
  return buildingApi.proRobOption.buildRobRecord.fetch(info)
}

function getSwitch() {
  return buildingApi.proRobOption.switchStatus.fetch({
    buildingId: dt.buildInfo().housesId
  })
}

function editSwitch(info) {
  return buildingApi.proRobOption.editSwitch.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId
  })
}

function getBuildProList() {
  return buildingApi.proRobOption.buildProtectList.fetch({
    buildingId: dt.buildInfo().housesId
  })
}

function editBuildProtect(info) {
  return buildingApi.proRobOption.editBuildProtect.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId,
    configContent: '案场内客户到访跟进保护期'
  })
}

function getRobRecord(info) {
  return buildingApi.proRobOption.robRecord.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId
  })
}

function getBuildProRecord(info) {
  return buildingApi.proRobOption.buildProRecord.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId
  })
}

function exportRobRecord(info) {
  return buildingApi.proRobOption.exportRob.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId
  })
}

function getTypeData(info) {
  return buildingApi.proRobOption.searchType.fetch({
    ...info,
    buildingId: dt.buildInfo().housesId
  })
}

function buildingConfigRecord(info) {
  return buildingApi.proRobOption.buildingConfigRecord.fetch(info)
}
function buildingConfigRecordExport(info) {
  return buildingApi.proRobOption.buildingConfigRecordExport.fetch(info)
}

function protectionOpenBuilding(info) {
  return buildingApi.proRobOption.protectionOpenBuilding.fetch(info)
}
function protectionOpenBuildingExport(info) {
  return buildingApi.proRobOption.protectionOpenBuildingExport.fetch(info)
}
function updateCompanyPoolButton(info) {
  return buildingApi.proRobOption.updateCompanyPoolButton.fetch(info)
}

export default {
  protectList,
  haveOrg,
  addOrgProtect,
  editOrgProtect,
  delOrgProtect,
  getProtectRecord,
  getRobList,
  editRobItem,
  getSwitch,
  editSwitch,
  getBuildProList,
  editBuildProtect,
  getRobRecord,
  getRobSopRecord,
  getBuildProRecord,
  exportRobRecord,
  getTypeData,
  buildingConfigRecord,
  buildingConfigRecordExport,
  protectionOpenBuilding,
  protectionOpenBuildingExport,
  updateCompanyPoolButton
}
